//存放token的话,先引入pinia
import {defineStore} from "pinia";
import admin from "@/api/admin.js";

//导入之后调用defineStore
export const useAdminInfoStore = defineStore("adminInfo", {
    //have two functions :1."state" for Storing data 2."action" is for storing functions
    state(){
        return{
            admin:{}
        }
    },
    //action里面存放方法
    actions:{
        setAdminInfo(admin) {
            this.admin = admin
        },
        removeAdminInfo(admin){
            this.admin = admin
        }
    },
    persist: {
        enabled: true, // 开启缓存  默认会存储在本地localstorage
    }
})